projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d38403c
)
initd: use patch_stdio() for kmodloader stdio redirection
author
Jo-Philipp Wich
<
[email protected]
>
Tue, 17 May 2016 15:00:45 +0000
(17:00 +0200)
committer
John Crispin
<
[email protected]
>
Mon, 16 May 2016 19:00:24 +0000
(21:00 +0200)
Signed-off-by: Jo-Philipp Wich <
[email protected]
>
initd/init.c
patch
|
blob
|
history
diff --git
a/initd/init.c
b/initd/init.c
index 4d17563d411c178a809196bfc6fc67347b7a25d4..e453cff21e426bc80bf7bc3cbf92df42aea0db80 100644
(file)
--- a/
initd/init.c
+++ b/
initd/init.c
@@
-86,17
+86,9
@@
main(int argc, char **argv)
if (!pid) {
char *kmod[] = { "/sbin/kmodloader", "/etc/modules-boot.d/", NULL };
- if (debug < 3) {
- int fd = open("/dev/null", O_RDWR);
-
- if (fd > -1) {
- dup2(fd, STDIN_FILENO);
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDERR_FILENO);
- if (fd > STDERR_FILENO)
- close(fd);
- }
- }
+ if (debug < 3)
+ patch_stdio("/dev/null");
+
execvp(kmod[0], kmod);
ERROR("Failed to start kmodloader\n");
exit(-1);